package com.wxw.demo.dao;

import com.wxw.demo.bean.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.beans.Transient;

/**
 * @author wxw
 * @data 2020/9/7 16 :36
 * @description
 */
public interface CommentRepository  extends JpaRepository<Comment,Integer> {
    @Transient
    @Modifying
    @Query("UPDATE t_comment c set c.author=?1 where  c.id=?2 ")
    public  int updateComment(String author,Integer id);
}
